﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Koonsoft.CustomerService.BLL;

namespace CustomerService.User
{
    public partial class WebForm1 : PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(TextBox1.Text) ||
                string.IsNullOrEmpty(TextBox2.Text) ||
                string.IsNullOrEmpty(TextBox3.Text))
            {
                AlertMsg("请输入密码");
                return;
            }
            if (TextBox2.Text != TextBox3.Text)
            {
                AlertMsg("两次输入密码不一致");
                return;
            }
            if (new EmployeeBLL().UpdagtePassword(LoginName, TextBox1.Text, TextBox2.Text))
            {
                AlterAndRedirect("密码修改成功", "../Default.aspx");
            }
            else
            {
                AlertMsg("密码修改失败");
            }
        }
    }
}